The present invention relates to an image processing apparatus and a control method therefor and, more particularly, to an image processing apparatus for reading an original image and transferring it to a host device, and a control method therefor.
The following method is known as a conventional method of reading an image by an image scanner.
First, to identify the whole image to be input, e.g., to determine whether the image to be currently read is correct or to set the scanning range, the image is provisionally scanned (prescanning). This prescanned image data is transmitted to the host. The host confirms the image or designates the region to be actually read (designate the trimming range). The desired region is scanned (scanning) on the basis of the prescanned image, thereby reading the image. If another region is to be designated, prescanning is performed again.
This prescanning operation is necessary before desired image data is read by scanning. Actually necessary data is the image data read by scanning. However, since the amount of read image data is large, the time necessary for prescanning and, more particularly, the time for transmitting data to the host cannot be ignored.
To solve the above problem or shorten the time required for prescanning, the read resolution in prescanning is set to be lower than that in scanning, i.e., the image is input at a low resolution to reduce the data amount, data is compressed in reading or transmission, a color image is prescanned to a monochromatic image, or a read color image is converted into a monochromatic image and then transmitted.
The transmission time can also be shortened by using a high-speed interface. In recent years, a USB (Universal Serial Bus) has received a great deal of attention as a high-speed serial interface for connecting a computer to a peripheral device. The specifications of this interface allow for relatively inexpensive connection of a computer to a peripheral device at a communication rate of 12 Mbps (a communication rate of 1.5 Mbps can also be used).
FIG. 17 shows a connection example of the USB.
Reference numeral 1701 denotes a host; 1702, a hub, and 1703, a device.
The host 1701 is an ordinary computer for controlling communication of the entire USB. The hub 1702 is a branchpoint in USB connection, to which a plurality of hubs or devices can be connected (the host 1701 has a hub function). The device 1703 is a peripheral device such as a modem, a printer, or a scanner.
The USB has a control transfer mode, an isochronous transfer mode, an interrupt transfer mode, and a bulk transfer mode. Control transfer is used to control the USB. Isochronous transfer is performed at a predetermined rate and does not permit any delay. That is, no retransmission due to an error is performed, though a predetermined band is guaranteed. Examples of applications in which isochronous transfer is used include a telephone or an audio device. As a characteristic feature, isochronous transfer has no correction for a communication error, though the data transfer band and time are guaranteed. In control transfer, interrupt transfer, and bulk transfer, retransmission is performed when a communication error occurs. A short response time is required for interrupt transfer. Examples of applications in which interrupt transfer is used include a pointing device such as a keyboard or a mouse. Bulk transfer has low priority although the data amount is large. Examples of applications in which bulk transfer is used include a printer or a scanner.
FIG. 18 shows the general bandwidths of the USB.
Reference numerals 1801 to 1804 denote frames to be repeatedly generated; 1805, an SOF (Start Of Frame) packet indicating the start of a frame; 1806 to 1808, bandwidths for isochronous transfer; 1809, a bandwidth for interrupt transfer; 1810, a bandwidth for bulk transfer; and 1811, an unused bandwidth.
A frame means a 1-ms period bandwidth generated in the USB. The bandwidths for the respective transfer modes are ensured in one frame. The bandwidth for isochronous transfer is assigned when the device is connected to the USB, and after this, a predetermined bandwidth is ensured. Bulk transfer uses a bandwidth which is not used for isochronous transfer. For this reason, when the bandwidth used for isochronous transfer is large, the capability of bulk transfer lowers.
As a high-speed serial interface other than the USB, an IEEE 1394 bus having a higher data transfer rate may be used.
For the IEEE 1394 (to be abbreviated as "1394" hereinafter), data transfer rates of 100, 200, and 400 Mbps are defined. A 1394 port having a higher transfer rate is defined to hold the compatibility to the lower speed. That is, the data transfer rates of 100, 200, and 400 Mbps can be used on the same network.
In addition, the 1394 uses a transfer format of a DS-Link coding scheme, thereby increasing the efficiency of the data transfer band as compared to 8B10B conversion (the start and stop bits are added to 8-bit data) as a general serial transfer format.
For the 1394, the transfer operation performed in the network is called a subaction. For the 1394, two subaction operations are defined. One is asynchronous transfer, and the other is a real-time transfer mode called isochronous transfer which guarantees the transfer band.
Each subaction is divided into three parts. These transfer states are sequentially called arbitration, packet transmission, and acknowledgement.
Asynchronous subaction is asynchronous transfer. FIG. 19 shows the time transition state in this transfer mode. The first subaction gap represents that the bus is idle. Since the 1394 is a serial bus, this gap time is monitored, i.e., it is checked whether the immediately preceding transfer operation is ended, thereby determining whether transfer can be performed.
Upon detecting the idle state for a predetermined or more time, the node which needs transfer determines that the bus can be used and executes arbitration to acquire the bus. It is a node positioned at the root (device having a 1394 port) that actually makes the decision for arbitration of the bus, as shown in FIG. 20. When the right to the bus is acquired by arbitration, data transfer (packet transmission) is executed. After data transfer, the node which has received the data returns "ack" (reception acknowledge code) for the received data. That is, bidirectional communication is performed. The "ack" is coded. Both nodes can confirm on the basis of the contents of this code whether transfer has been normally performed.
After this, the subaction gap (idle) is detected again, and the transfer operation is repeated.
The 1394 transfers data as a packet. When transfer is complete, the bus is immediately released. This allows effective use of the band. Packet data has a header portion and a data portion. The header portion contains information such as the other party address, the self node address, and the transfer data size. The data portion contains actual transfer data in quartet units (4 bytes). Each of the header and data portions has CRC data to ensure the reliability of the data.
When the node executes transfer, the data is transferred to all nodes in the bus. Each node reads the header address of the packet. If the packet data is addressed to the self node, the node receives it.
FIG. 21 shows the time transition state in isochronous transfer. Since isochronous transfer is executed at an interval of about 8 kHz with priority over asynchronous transfer, the isochronous transfer mode guarantees the transfer band. Therefore, real-time data transfer can be realized.
However, isochronous transfer is executed by broadcasting, so no ack code is returned upon reception. That is, because of one-directional communication, it cannot be confirmed whether transfer has been normally performed. The transfer format of isochronous transfer uses a channel ID in place of a node address.
When a plurality of nodes are to simultaneously perform real-time data (isochronous) transfer, a channel ID number for identifying the contents (transmission node) is set for each transfer data. A node which is to receive the data sets a target ID and receives desired isochronous data.
Isochronous transfer will be described in more detail with reference to FIG. 23.
One isochronous cycle is set from the cycle start to the next cycle start data. This cycle starts at an interval of 8 kHz (125 .mu.s) on average. After the cycle start data, isochronous transfer starts upon detecting a subaction gap shorter than that of asynchronous transfer.
When isochronous transfer is complete, asynchronous transfer can be executed until the next cycle. Each node makes determination therefor upon detecting that the subaction gap after isochronous transfer has a length for allowing the start of asynchronous transfer. Even when asynchronous transfer continues to the next cycle start data transfer time, asynchronous transfer is not interrupted. The next cycle start waits until the bus idles, and then, the cycle start is issued. If a certain cycle continues over 125 .mu.s, the next cycle is shortened. However, isochronous transfer is always executed. Therefore, real-time data such as video or audio data can be handled at the same transfer cycle. The cycle start data is managed by the cycle master node (root) of the 1394 network.
For the above-described transfer as well, it is important to decrease the amount of prescanned image data to be transmitted. Once data to be transmitted is determined, the data is checked such that it can be reliably received by the host. For this purpose, error check or retransmission is performed resulting in a longer transmission time.
In a bus interface such as a USB (Universal Serial Bus) having a plurality of transfer modes and scheduled at a specific period, the bandwidths of the respective transfer modes are assigned in one period (one frame). Bulk transfer used to transfer a large quantity of data such as image data read by a scanner has low priority as compared to the remaining transfer modes. For this reason, when the traffic in the bus is large (when priority transfer is being performed), data cannot be transmitted at a desired transfer rate.